include ./../../make.settings

LIB_SFIOT_SDK=$(SFIOT_PLATFORM_LIB_NAME).a
LIB_SFIOT_PLATFORM=$(SFIOT_SDK_LIB_NAME).a

CC=$(PLATFORM_CC)
CFLAGS += -std=gnu99 -Wall -g
LDFLAGS = -lm -pthread

ifeq ($(PLATFORM_OS), windows)
LDFLAGS += -lws2_32
endif

INCLUD_PATH += -I./../../src/mqttclient/
#INCLUD_PATH += -I./../../src/system/
INCLUD_PATH += -I./../../src/utility/
#INCLUD_PATH += -I./../../src/shadow/
INCLUD_PATH += -I./../../src/platform/

TARGET = mqtt

all:
	$(CC) $(CFLAGS) $(INCLUD_PATH) -o $(TARGET) *.c ../../build_out/$(LIB_SFIOT_PLATFORM) ../../build_out/$(LIB_SFIOT_SDK) $(LDFLAGS)
	
clean:
	$(make mqtt--- =  $(TARGET))
	rm -rf $(TARGET)
